package com.hzj.rtsp;

import com.hzj.rtsp.task.SpringContextHolder;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.FFmpegFrameRecorder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.util.Calendar;

/**
 * Created by Hzj on 2021/6/17.
 */
@SpringBootApplication
public class RtspApplication {
    public static void main(String[] args){

        try {
            FFmpegFrameGrabber.tryLoad();
            FFmpegFrameRecorder.tryLoad();
        } catch (org.bytedeco.javacv.FrameRecorder.Exception e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }

        final ApplicationContext applicationContext =   SpringApplication.run(RtspApplication.class, args);
        // 将上下文传入RealPlay类中,以使其使用config中的变量
        SpringContextHolder.applicationContext = applicationContext;
    }
}
